/*----------------------------------------------------------------------
  - File name      : STC8Ax_POWER.c
  - Author         : Quark Team
  - Update date    : 2020-08-18                  
  -	Copyright      : Gevico Electronic studio   
  - Module comments: System power management module.
-----------------------------------------------------------------------*/
/*-----------------------------------------------------------------------
|                               INCLUDES                                |
-----------------------------------------------------------------------*/
#include "STC8Ax_POWER.h"
/*-----------------------------------------------------------------------
|                                 DATA                                  |
-----------------------------------------------------------------------*/
/* None */
/*-----------------------------------------------------------------------
|                               FUNCTION                                |
-----------------------------------------------------------------------*/

/*--------------------------------------------------------
| @Description: Power mode configure function            |
| @param      : POWERMode_Type Mode                      |
| @return     : FSCSTATE : Success / Fail                |
--------------------------------------------------------*/

FSCSTATE POWER_MODE_CONFIG(POWERMode_Type Mode)
{
  PCON = (PCON & 0xFC) | Mode;
  return FSC_SUCCESS;
}

/*--------------------------------------------------------
| @Description: Get power state function                 |
| @param      : None                                     |
| @return     : uint8 power state                        |
--------------------------------------------------------*/

uint8 GET_POWER_STATE(void)
{
  return (PCON & 0x10);
}

/*-----------------------------------------------------------------------
|          END OF FLIE        (C) COPYRIGHT Gevico Electronics          | 
-----------------------------------------------------------------------*/



